package com.czmh.etc.onlinepubsys.request.wj;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.czmh.etc.onlinepubsys.entity.wj.CarInfo;
import com.czmh.etc.onlinepubsys.utils.DatetimeUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * Copyright (C), 2017-2024
 *
 * @Author: lyk
 * Date: 2024-04-02
 * FileName: SaveCarInfoRequest
 * Description:
 */
@ApiModel("万集 新增车辆信息-对接请求对象")
@Data
public class SaveCarInfoRequest {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = "用户 ID", required = false)
    @JSONField(serialize = false)
    private String userId; //用户ID

    @ApiModelProperty(notes = "加密方式", required = false)
    private String signType = "MD5";

    @ApiModelProperty(notes = "加密值", required = false)
    private String sign;

    @ApiModelProperty(notes = "时间戳", required = false)
    private long timestamp;

    @ApiModelProperty(value = "车主姓名", required = false)
    private String carOwner;

    @ApiModelProperty(value = "车牌号", required = false)
    private String vehPlateNo;

    @ApiModelProperty(value = "车牌号类型 02-小型汽车,蓝牌 01-大型汽车,黄牌 51-大型新能源车辆,黄绿牌 52-小型新能源车辆,绿白牌", required = false)
    private String carType;

    @ApiModelProperty(value = "车型种类（0：未知 1 ：轿 车 2 ： 客车 3：货车、4： 专项作业车、1427:货车牵引车、1424:仅货物专用运输(集装 箱 ) 牵引车 ）、1428:其他类型牵引车型种类（0：未知 1 ： 轿 车 2 ： 客车 3：货车、4：专项作业车、1427:货车牵引车、1424:仅货物专用运输(集装 箱 ) 牵引车 ）、1428:其他类型牵引车", required = false)
    private String vehType;

    @ApiModelProperty(value = "车辆识别代号", required = false)
    private String vehVin;

    @ApiModelProperty(value = "车辆长，小于 6000", required = false)
    private String vehLength;

    @ApiModelProperty(value = "车辆宽", required = false)
    private String vehWidth;

    @ApiModelProperty(value = "车辆高", required = false)
    private String vehHeight;

    @ApiModelProperty(value = "车轮数", required = false)
    private String vehWheels;

    @ApiModelProperty(value = "车辆发动机号", required = false)
    private String vehEngineNumber;

    @ApiModelProperty(value = "车轴数", required = false)
    private String vehAxles;

    @ApiModelProperty(value = "车品牌型号", required = false)
    private String vehBrandCode;

    @ApiModelProperty(value = "车身质量 （ 整备质量）", required = false)
    private String vehBodyWeight;

    @ApiModelProperty(value = "车辆行驶证注册日期 yyyy-MM-dd", required = false)
    private String vehLicenseRegistdate;

    @ApiModelProperty(value = "核定载质量 Kg/座位数（客车时，为座位数、货车时为核定载质 量 。 当为牵引车时 ，填写准牵引质量）", required = false)
    private String vehTotalWeight;

    @ApiModelProperty(value = "货车核定载人数", required = false)
    private Integer vehLimitManned;

    @ApiModelProperty(value = "车牌颜色 0-蓝；1-黄；2-黑；3-白；4-绿白；5-绿黄；", required = false)
    private String plateColor;

    @ApiModelProperty(value = "用户标识", required = false)
    private String gid;

    public static CarInfo convert(SaveCarInfoRequest req) {
        CarInfo carinfo = new CarInfo();
        carinfo.setUserId(req.getUserId());
        carinfo.setCarOwner(req.getCarOwner());
        carinfo.setVehPlateNo(req.getVehPlateNo());
        carinfo.setCarType(req.getCarType());
        carinfo.setVehType(req.getVehType());
        carinfo.setVehVin(req.getVehVin());
        carinfo.setVehLength(req.getVehLength());
        carinfo.setVehWidth(req.getVehWidth());
        carinfo.setVehHeight(req.getVehHeight());
        carinfo.setVehWheels(req.getVehWheels());
        carinfo.setVehEngineNumber(req.getVehEngineNumber());
        carinfo.setVehAxles(req.getVehAxles());
        carinfo.setVehBrandCode(req.getVehBrandCode());
        carinfo.setVehBodyWeight(req.getVehBodyWeight());
        carinfo.setVehLicenseRegistdate(req.getVehLicenseRegistdate());
        carinfo.setVehTotalWeight(req.getVehTotalWeight());
        carinfo.setVehLimitManned(req.getVehLimitManned());
        carinfo.setPlateColor(req.getPlateColor());
        carinfo.setGid(req.getGid());

        return carinfo;
    }
}
